<!-- BEGIN PAGE HEADER-->
<style>
    .ibox label {
        margin-left: 8px;
        margin-bottom: 8px;
    }
</style>
<?php $this->load->view('partials/breadcrumb.tpl', Array('_NO_IOSS_NEW' => '1')) ?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script type="text/javascript">
    function defConfirm(url) {
        if (!confirm("确定要删除吗？")) {
            return false;
        }
        window.location.href = url;
        return true;
    }

    $(document).ready(function () {
        $("#reset").click(function () {
            $("select").val('');
            $("input[type='text']").val('');
        });
    });
</script>
<div class="row">
    <div class="col-xs-12">
        <!-- Begin: life time stats -->
        <div class="portlet">
            <?= form_open('', Array('class' => 'form-inline', 'role' => 'form')) ?>
            <?= search_form_input('task_id', filterValue('task_id'), '任务ID', 'class="form-control input-xs"'); ?>
            <?= search_form_input('order_no', filterValue('order_no'), '买家下单号', 'class="form-control input-xs"'); ?>
            <?php if ($this->_user->role_id == 1): ?>
                <?= search_form_dropdown('operator_id', array('' => '接单者...') + $allReviewsAdmin, filterValue('operator_id') ? filterValue('operator_id') : ($currentRoleId != 1 ? $currentAdminId : ''), '接单者', 'class="form-control input-xs"'); ?>
            <?php endif; ?>
            <?= search_form_dropdown('group_id', array('' => '所属销售组...') + $allSaleGroups, filterValue('group_id'), '所属销售组', 'class="form-control input-xs"'); ?>
            <?= search_form_dropdown('shop_id', array('' => '所属店铺...') + $allShops, filterValue('shop_id'), '所属店铺', 'class="form-control input-xs"'); ?>
            <?= search_form_input('taskrecords_number_perpage', filterValue('taskrecords_number_perpage'), '每页显示条数', 'class="form-control input-xs"'); ?>
            <div style="clear:both;height:10px;"></div>

            <div class="input-group input-large date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
                <input type="text" class="form-control" name="task_records_create_time_begin" value="<?= filterValue('task_records_create_time_begin') ?>" placeholder="申请开始时间" autoComplete="off">
                <span class="input-group-addon">to </span>
                <input type="text" class="form-control" name="task_records_create_time_end" value="<?= filterValue('task_records_create_time_end') ?>" placeholder="申请结束时间" autoComplete="off">
            </div>

            <div class="input-group input-large date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
                <input type="text" class="form-control" name="task_records_update_time_begin" value="<?= filterValue('task_records_update_time_begin') ?>" placeholder="处理开始时间" autoComplete="off">
                <span class="input-group-addon">to </span>
                <input type="text" class="form-control" name="task_records_update_time_end" value="<?= filterValue('task_records_update_time_end') ?>" placeholder="处理结束时间" autoComplete="off">
            </div>
            <label style="float: right;margin-right: 20px" class="label label-danger">总计<?= $total_number ?>条</label>
            <button type="button" class="btn default" id="reset">重置条件</button>
            <button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
            <?= form_close() ?>
            <div class="portlet-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-scrollable">
                            <form id="ajax_merge_form" action="" method="post" onsubmit="return false">
                                <table class="table table-hover table-bordered table-striped">
                                    <thead>
                                    <tr>
                                        <th width="2%">ID</th>
                                        <th width="3%">任务ID</th>
                                        <th width="8%">商品名称</th>
                                        <th width="5%">店铺</th>
                                        <th width="5%">接单者</th>
                                        <th width="6%">买家下单号</th>
                                        <th width="6%">创建时间</th>
                                        <th width="6%">更新时间</th>
                                        <th width="12%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach ($list as $v) { ?>
                                        <tr>
                                            <td><?= $v->id ?></td>
                                            <td><?= $v->task_id ?></td>
                                            <td>
                                                <a style="color:#008200;"
                                                   href="<?= site_url('/tasks/task/view/' . $v->task_id) ?>"><?= $v->product_name ?>
                                                </a>
                                            </td>
                                            <td><?= $allShops[$v->shop_id] ?></td>
                                            <td><?= $allReviewsAdmin[$v->operator_id]; ?></td>
                                            <td><?= $v->order_no ?></td>
                                            <td><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
                                            <td><?= ($v->create_time == $v->update_time && $v->update_time !== 0) ? '' : date('Y-m-d H:i:s', $v->update_time) ?></td>
                                            <td>
                                                <a href="javascript:ioss_url_modal('<?= site_url('/tasks/taskrecords/ajaxViewDetail/' . $v->id) ?>');" class="btn btn-sm blue <?= $p->read ? '' : 'disabled' ?>"><i class="fa fa-play"></i> 查看</a>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 text-right">
                        <?= $pagination ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- End: life time stats -->
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $('.img-rounded').zoomify();

        $(document).on('click','body img.modal-img',function(){
            console.log('img loaded');
            $('.modal-img').zoomify();
        });

    });
</script>
<!-- END PAGE CONTENT-->